from multiprocessing import Process
from time import sleep


n=1
def task1():
    global n
    while True:
        sleep(1)
        n=n+1
        print('---task1------',n)


def task2():
    global n
    while True:
        sleep(1)
        n=n+1
        print('---task2------',n)

if __name__ == '__main__':
    p1=Process(target=task1)
    p2=Process(target=task2)

    p1.start()
    p2.start()
'''
---task1------ 2
---task2------ 2
---task1------ 3
---task2------ 3
---task1------ 4
---task2------ 4

'''
